<!DOCTYPE html>
{% extends 'base.html' %}
{% load crispy_forms_tags %}

{% block content %}
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>Django_Voting</title>
</head>

<body>

    <div class="mt-5 p-3">
        <h1>Создание голосования</h1>

        <div class="mt-3 mb-3">
            <a href="/votings/create"><input class="btn btn-primary" type="submit" value="2 варианта ответа"></a>
            <a href="?vars=3"><input class="btn btn-primary" type="submit" value="3 варианта ответа"></a>
            <a href="?vars=4"><input class="btn btn-primary" type="submit" value="4 варианта ответа"></a>
        </div>

        {% if messages %}
                    {% for message in messages %}
                        <div class="alert {{message.tags}} alert-dismissible fade show" role="alert">
                        {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                        </div>
                    {% endfor %}
        {% endif %}

        <form action="" method="post">
            {% csrf_token %}
            {% load crispy_forms_tags %}
            {{ form|crispy }}
            <input class="btn btn-primary" type="submit" value="Создать">
        </form>

        {{ title }} <br>
        {{ variants }}
    </div>
</body>
</html>
{% endblock %}